package com.lifeng.springevent.defaultevent;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.ContextStartedEvent;
import org.springframework.context.event.ContextStoppedEvent;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * Created by lifeng on 2019/8/5.
 * ContextStoppedEvent 监听Spring容器容器开始停止的事件 ,stop方法触发
 * ApplicationContext停止后触发的事件；（目前版本没有任何作用）
 */
@Component
public class MySpringStopedListener implements ApplicationListener<ContextStoppedEvent>{
    private static final Logger log = LoggerFactory.getLogger(MySpringStopedListener.class);

	@Override
	public void onApplicationEvent(ContextStoppedEvent event) {
		System.out.println("stoped...");
	}

}
